package org.longIt.springdata.controller;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.longIt.springdata.domain.Clazz;
import org.longIt.springdata.domain.Student;
import org.longIt.springdata.service.StudentService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class StudentController {
	
	@Resource
	private StudentService studentService;
	
		
	
	@RequestMapping("/index")
	public String index() {
		return "index";
	}
	
	@RequestMapping("/findStuDynamic")
	public String findStuDynamic(Model model,Student student) {
		System.out.println("student -> " + student);
		List<Student> students = studentService.findStuDynamic(student);
		model.addAttribute("students", students);
		return "studentslist";
	}
}
